<?php
/**
 * Created by PhpStorm.
 * User: lphwxl
 * Date: 2018/7/12
 * Time: 13:36
 */

namespace App\Services;

use App\Exceptions\TokenNotExists;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;

class BaseValidator
{

    public function check($params=[]){

        $validator = Validator::make($params,$this->rules,$this->message);
        if($validator->fails()){
            throw new TokenNotExists($validator->errors()->first(),401);
        }
    }

}